package #Package(${basePackage} "domain.request.dto");


import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.List;

/**
 * <p>
 *    $table.tableComment
 * </p>
 *
 * @author ${author}
 * @date ${date}
 * @remark ${remark}
 */
public class ${EntityName}Dto {


    @Data
    @ApiModel(value = "${EntityName}-PageListParam")
    public static class PageListParam{
        private Integer pageNo = 1;
        private Integer pageSize = 10;

#foreach($column in ${table.columnInfos})
#if($column.checked && $column.queryChecked && $column.javaFieldName != "id" && $!commonColumns.contains($column.javaFieldName) == false )
#set($type = "#SplitAndGetLastOne($column.javaFieldType '.')" )
#if( $type == "Date")
        @ApiModelProperty(value = "${column.columnComment}" )
        @JsonFormat(pattern="yyyy-MM-dd")
        private ${column.javaFieldType} ${column.javaFieldName}Start;
        @JsonFormat(pattern="yyyy-MM-dd")
        private ${column.javaFieldType} ${column.javaFieldName}End;
#else
        @ApiModelProperty(value = "${column.columnComment}" )
        private ${column.javaFieldType} ${column.javaFieldName};
#end
#end
#end

    }

    @Data
    @ApiModel(value = "${EntityName}-DetailParam")
    public static class DetailParam{
        @NotNull(message = "id不能为空")
        @ApiModelProperty(value = "id",required = true)
        private Long id;
    }

    @Data
    @ApiModel(value = "${EntityName}-AddParam")
    public static class AddParam{

#foreach($column in ${table.columnInfos})
#if($column.checked && $column.javaFieldName != "id" && $!commonColumns.contains($column.javaFieldName) == false )
        @ApiModelProperty(value = "${column.columnComment}" )
        private ${column.javaFieldType} ${column.javaFieldName};

#end
#end

    }

    @Data
    @ApiModel(value = "${EntityName}-UpdateParam")
    public static class UpdateParam{
        @NotNull(message = "id不能为空")
        @ApiModelProperty(value = "id",required = true)
        private Long id;

#foreach($column in ${table.columnInfos})
#if($column.checked && $column.javaFieldName != "id" && $!commonColumns.contains($column.javaFieldName) == false)
        @ApiModelProperty(value = "${column.columnComment}" )
        private ${column.javaFieldType} ${column.javaFieldName};

#end
#end

    }

    @Data
    @ApiModel(value = "${EntityName}-DeleteParam")
    public static class DeleteParam{
        @NotNull(message = "id不能为空")
        @ApiModelProperty(value = "id",required = true)
        private Long id;
    }

    @Data
    @ApiModel(value = "${EntityName}-BatchDeleteParam")
    public static class BatchDeleteParam{
        @Valid
        @ApiModelProperty(value = "ids",required = true)
        @NotEmpty(message = "id列表不能为空")
        private List<Long> ids;
    }

    @Data
    @ApiModel(value = "${EntityName}-IdParam")
    public class IdParam{
        @NotNull(message = "id不能为空")
        @ApiModelProperty(value = "id",required = true)
        private Long id;
    }

    @Data
    @ApiModel(value = "${EntityName}-IdListParam")
    public class IdListParam {
        @Valid
        @ApiModelProperty(value = "ids",required = true)
        @NotEmpty(message = "id列表不能为空")
        private List<Long> ids;
    }

}









